package news.yp.newsproject.presenter.presenter;

import com.news.yp.baselibrary.base.BaseView;

import io.reactivex.Flowable;
import news.yp.newsproject.bean.ResponseDetailData;
import news.yp.newsproject.bean.ResponsePageData;
import news.yp.newsproject.bean.ResponseSectionData;

/**
 * 定义View层和Model层的接口
 * 这是一个规范可有可无
 */
public class CenterPresenter {
    /**
     * View层
     */
    public interface ViewPresenter<T> extends BaseView {
        void onLoading();

        void onError();

        void onSuccess(T response);

        void onPageSuccess(ResponsePageData requestPageData);
    }

    public interface DetailViewPresenter extends BaseView {
        void onLoading();

        void onError();

        void onDetailSuccess(ResponseDetailData responseDetailData);

    }

    /**
     * Model层
     */
    public interface ModelPresenter {
        Flowable<ResponseSectionData> getSectionData();

        Flowable<ResponsePageData> getpageData(String section, int num, int page);
    }

    interface DataPresenter {
        void getSection();

        void getpage(String name, int num, int page);
    }
}
